/* 
* @Author: anchen
* @Date:   2018-04-19 16:45:15
* @Last Modified by:   anchen
* @Last Modified time: 2018-04-19 17:30:05
*/

'use strict';
var arr=[100,34,123,24,50,9,8,10]
function sort(arr){
   for(var i = 0;i<arr.length;i++){
        for(var j=i+1;j<arr.length;j++){
            if(arr[j]<arr[i]){
                var temp=arr[i]
                arr[i]=arr[j];
                arr[j]=temp
            }
        }
   }
   return arr
}
console.log(sort(arr))